Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[workspace-hack] use workspace-dotted format and a patch directive #4197

Conversation

sunshowers
Copy link
Contributor

@sunshowers sunshowers commented Oct 4, 2023

Two changes:

  1. Switch to the workspace-dotted format (.workspace = true) for
    uniformity with the rest of omicron. This is new in cargo-hakari
    0.9.28.

  2. Use a patch directive, which means that the workspace-hack only
    applies while building within this workspace. If another workspace
    imports a crate from here via a git dependency, it will not have the
    workspace-hack applied to it (instead, it will use this empty crate
    on crates.io). Thanks so much to @pfmooney for this
    suggestion!

Also remove one of the exceptions made in the xtask (workspace-hack
lines in other Cargo.tomls are now output as .workspace = true,
but hakari cannot yet generate workspace lines in its own Cargo.toml).

I verified by creating an empty project that the workspace-hack isn't applied to downstream projects that import e.g. omicron-common as a git (or path) dependency.

Folks will have to update to cargo-hakari 0.9.28 to use this, but hopefully that won't be too much of a bother.

Created using spr 1.3.4
@sunshowers sunshowers merged commit a9104a0 into main Oct 4, 2023
23 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/workspace-hack-use-workspace-dotted-format-and-a-patch-directive branch October 4, 2023 07:12
sunshowers added a commit to oxidecomputer/crucible that referenced this pull request Oct 4, 2023
)

Similar to oxidecomputer/omicron#4197, this PR
has two changes:

1. Switch to the workspace-dotted format (`.workspace = true`) for
   uniformity with the rest of crucible. This is new in cargo-hakari
   0.9.28.

2. Use a patch directive, which means that the workspace-hack only
   applies while building within this workspace. If another workspace
   imports a crate from here via a git dependency, it will not have the
   workspace-hack applied to it (instead, it will use [this empty crate](https://crates.io/crates/crucible-workspace-hack)
   on crates.io). Thanks so much to @pfmooney for this
   suggestion!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants